package com.cloud.mapper;

import com.cloud.entity.Goods;
import com.cloud.entity.GoodsType;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;



@Repository
public interface GoodsMapper {

    int addType(GoodsType type);

    int delTypeById(@Param("id") String id);

    int updateType(GoodsType type);

    GoodsType findById(@Param("id") String id);

    GoodsType findByName(@Param("name") String name);

    int getTypeCount(@Param("name") String name);

    List<GoodsType> findAllByPage(@Param("page") int page, @Param("limit") int limit, @Param("name") String name);

    List<GoodsType> findAll();

    int addGoods(Goods goods);

    int delGoodsById(@Param("id") int id);

    int updateGoods(Goods goods);

    int getGoodsCountByPage(@Param("type") String type, @Param("name") String name);

    List<Goods> findGoodsByPage(@Param("page") Integer page, @Param("limit") Integer limit,
                                @Param("type") String type, @Param("name") String name);

    Goods findGoodsById(@Param("id") int id);

    Goods findGoodsByName(@Param("name") String name);

    List<String> findAllGoodsByName(@Param("name") String name);

}
